package Dream;

public class down {
    public static void main(String[] args) {
        String s1 = "abcdef";
        String s2 =new String("ABCDEF");
        char[] arryr =  {'a','b','c','d','e','f'};
        String s3 = new String(arryr);
        String s4 ="aaabbbcccddd";
//        System.out.println(s3.charAt(10));
        System.out.println(s4.indexOf('e'));

    }
    public static void main3(String[] args) {


            String s1 = new String("abc");
            String s2 = new String("ac");
            String s3 = new String("ABc");
            String s4 = new String("abcdef");
            String s5 = "ABC";
            System.out.println(s1.compareToIgnoreCase(s2)); // 不同输出字符差值-1
            System.out.println(s1.compareToIgnoreCase(s3)); // 相同输出 0
            System.out.println(s1.compareToIgnoreCase(s4)); // 前k个字符完全相同，输出长度差值 -3
        System.out.println("=======================");
        System.out.println(s1.compareTo(s2));
        System.out.println(s1.compareToIgnoreCase(s5));


    }
    public static void main2(String[] args) {
        String s1 = "abcdef";
        String s2 = new String("abcdefgh");
        char[]arryr = {'a','b','c','d','e','f'};
        String s3 = new String(arryr);
        System.out.println(s1.equals(s2));
        System.out.println(s1.equals(s3));
        System.out.println(s2.equals(s3));
    }

    public static void main1(String[] args) {
        String S1 = "ABCDEF";//直接赋值
        String S2 =new String("abcdef");//new一个新的对象
        char[] arryr = {'a','b','c','d','f'};//通过数组构造
        String S3 = new String(arryr);
        S3 = S1;
        System.out.println(S1==S2);
        System.out.println(S2==S3);
        System.out.println(S3==S1);
        System.out.println("==================");
        int a = 10;
        int b = 20;
        int c = 10;

        System.out.println(a == b);
        System.out.println(b == c);
        System.out.println(a == c);
    }


}
